#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time      :2021/7/2 14:18
# @Author    :cjw
from os.path import dirname, join

# 服务地址
COMMAND_EXECUTOR_IP = 'http://127.0.0.1'

# 项目根目录
BASE_PATH = dirname(__file__)

"""运行结果数据"""
# result结果目录
RESULT_PATH = join(BASE_PATH, 'result')
# allure报告目录
REPORT_PATH = join(BASE_PATH, 'report')
# log目录路径
LOG_PATH = join(BASE_PATH, 'log')

"""YAML文件"""
# 元素定位文件
ELEMENT_YML_PATH = join(BASE_PATH, 'data', 'locator_yml')
ELEMENT_YML = {
    'amp': join(ELEMENT_YML_PATH, 'add_member_page.yml'),
    'clp': join(ELEMENT_YML_PATH, 'contact_list_page.yml'),
    'emp': join(ELEMENT_YML_PATH, 'edit_member_page.yml'),
    'mp': join(ELEMENT_YML_PATH, 'main_page.yml'),
    'pig': join(ELEMENT_YML_PATH, 'person_information_page.yml'),
    'psg': join(ELEMENT_YML_PATH, 'person_setting_page.yml'),
    'epp': join(ELEMENT_YML_PATH, 'edit_person_page.yml')
}

# 测试数据文件
DATA_YML_PATH = join(BASE_PATH, 'data', 'data_yml')
DATA_YML = {
    'ad': join(DATA_YML_PATH, 'add_member.yml')
}

# app启动参数文件
DES_CAPS = join(BASE_PATH, 'data', 'des_caps.yml')

"""时间等待"""
WEBDRIVER_WAIT_TIMEOUT = 10  # 显示等待
IMPLICITLY_WAIT = 3  # 隐式等待

# 元素定位方式
MOBILE_BY_RULES = {'id', 'xpath', 'link text', 'partial link text', 'name', 'tag name', 'class name',
                   'css selector', '-ios predicate string', '-ios uiautomation', '-ios class chain',
                   '-android uiautomator', '-android viewtag', '-android datamatcher', '-android viewmatcher',
                   '-windows uiautomation', 'accessibility id', '-image', '-custom'}